package com.lovo;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lovo.bean.Detail;
import com.lovo.bean.Tender2;
import com.lovo.mapper.Tender2Mapper;
import com.lovo.service.IDetailService;
import com.lovo.service.ISysGoodsService;
import com.lovo.service.ITender2Service;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest
@RunWith(SpringRunner.class)
public class HdT {
    @Autowired
    ITender2Service service;

    @Autowired
    ISysGoodsService goodsService;

    @Autowired
    IDetailService detailService;

    @Test
    public  void  tenderT(){
//        Tender2 tender2=new Tender2();
//
//        tender2.setProductname("好多鱼");
//        tender2.setTCount(300);
//        tender2.setTInfo("好多好多好多鱼");
//        tender2.setTSize("500g");
//        tender2.setTType("食品");
//        service.sendTender(tender2);

        IPage iPage=service.findAllTender(1);
        System.out.println(iPage.getRecords());
        service.updateTender(3);

    }

    @Test
    public  void  SysGoods(){


    }

    @Test
    public  void  DetailT(){
        Detail detail=new Detail();
        detail.setNum(20);
        detail.setGoodsname("好多鱼");
        detail.setDBatch("gfdsdfgh");
        detail.setDCode("123132dd");
        detail.setDPrice(19);
        detail.setGoodsid(1);
        detail.setDType("食品");
        detail.setDSize("500g");
        detailService.sendDetail(detail);

//    detailService.sellProduct(1,20);

        System.err.println(detailService.findDetailByProductId(1));

    }

}
